{% extends "base.html" %}
{% load static %}

{% block title %}
    Admin Dashboard | {{ block.super }}
{% endblock title %}


{% block content %}
    {% include "_admin_sidebar.html" %}

    <!--main content start-->
    <section id="main-content">

        <section class="wrapper">

            <div class="table-agile-info">
                <div class="panel panel-default">

                    <div class="panel-heading">
                        {{ view.section_title }}
                    </div>

                    <div class="row w3-res-tb">
                        {% include "_message.html" %}
                    </div>

                    <div class="row w3-res-tb">
                        <div class="col-sm-5 m-b-xs">
                        </div>

                        <div class="col-sm-4">
                        </div>

                        <div class="col-sm-3">
                            {% include "_search_form.html" %}
                        </div>
                    </div>

                    {% if user_list %}
                        <div class="table-responsive">

                            <table class="table table-striped b-t b-light">
                                <thead>
                                <tr>
                                    <th>Username</th>
                                    <th>Email</th>
                                    <th>First Enrollment</th>
                                    <th>Last Login</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for user in user_list %}
                                    <tr>
                                        <td>
                                            {{ user.username }}
                                            <a href="{% url "user:edit" user.id %}">
                                                <span class="glyphicon glyphicon-edit"></span>
                                            </a>
                                        </td>
                                        <td>{{ user.email }}</td>
                                        <td>{{ user.get_first_enrollment }}</td>
                                        <td>{{ user.date_joined }}</td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>

                        </div>

                        <footer class="panel-footer">

                            {% include "_pagination.html" %}

                        </footer>

                    {% else %}
                        <div class="well">No users yet.</div>
                    {% endif %}

                </div>
            </div>
        </section>

    </section>
    <!--main content end-->

{% endblock content %}
